package com.huiminpay.transaction.api.service;

import com.huiminpay.common.cache.domain.BusinessException;
import com.huiminpay.transaction.api.dto.PayChannelDTO;
import com.huiminpay.transaction.api.dto.PayChannelParamDTO;
import com.huiminpay.transaction.api.dto.PlatformChannelDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PayChannelService {
    /**
     * 查询服务平台列表
     * @return
     * @throws BusinessException
     */
    List<PlatformChannelDTO> queryPlatformChannel() throws BusinessException;
    /**
     * 应用是否绑定平台服务类型
     * @param appId
     * @param platformChannelCodes
     * @throws BusinessException
     */
    void isBindPlatform(String appId,String platformChannelCodes) throws BusinessException;
    /**
     * 根据appId和平台服务类型code查询中间表app_platform_channel
     * @param appId
     * @param platformChannel
     * @return
     * @throws BusinessException
     */
    int queryIsBind(String appId,String platformChannel) throws BusinessException;
    /**
     * 根据平台服务类型获取支付渠道列表
     * @param platformChannelCode
     * @return
     * @throws BusinessException
     */
    List<PayChannelDTO> queryPayChannelByPatformChannel(String platformChannelCode) throws BusinessException;
    /**
     * 商户配置支付渠道参数
     * @param payChannelParamDTO
     * @throws BusinessException
     */
    void savePayChannelParam(PayChannelParamDTO payChannelParamDTO) throws BusinessException;

    /**
     * 根据appIdand和PlatformChannel查询参数列表
     * @param appId
     * @param platformChannel
     * @return
     * @throws BusinessException
     */
    List<PayChannelParamDTO> queryListPayChannelParamByappIdandPlatformChannel(String appId,String platformChannel)
            throws BusinessException;
    /**
     * 根据appIdand和PlatformChannel查询某个商户参数
     * @param appId
     * @param platformChannel
     * @param payChannel
     * @return
     * @throws BusinessException
     */
    PayChannelParamDTO queryPayChannelParamByappIdandPlatformChannel(String appId,String platformChannel,String payChannel)
            throws BusinessException;
}
